#pragma once
#include <string>

class Buffer
{
private:
    std::string m_buf;
    //0 只有报文
    //1 报文长度+报文
    const uint16_t M_SEP;

public:
    Buffer(uint16_t sep = 1);
    ~Buffer();
    void append(const char *data, size_t size);
    void append_by_sep(const char *data, size_t size);
    size_t size();
    const char *data();
    void clear();
    void erase(size_t pos, size_t n);
    bool pick_message(std::string& ss);
};